#include <stdio.h>
#define TABSPACE 4

int main(void) {
    int c, i, blankCount;
    blankCount = 0;

    while ((c = getchar()) != EOF) {
        if (c == ' ') {
            blankCount++;
            if (blankCount == TABSPACE) {
                putchar('\t');
                blankCount = 0;
            }
        } else {
            for (i = 0; i < blankCount; i++) {
                putchar(' ');
            }
            blankCount = 0;
            putchar(c);
        }
    }
    return 0;
}